package com.mgg.message.controller.sms;

import com.mgg.common.util.ResultVOUtil;
import com.mgg.message.service.sms.SmsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/sms")
public class SmsController {
	
	Logger log = LoggerFactory.getLogger(getClass());
	
	@Autowired
	private SmsService smsService;
	
	/**
	 * 短信发送
	 * @return
	 * @throws Exception
	 */
	@GetMapping(path="/send")
	public Object sendSms(@RequestParam("sms_type") Integer smsType,
			@RequestParam("sub_type") Integer subType,
			@RequestParam("mobile") String mobile,
			@RequestParam("param") String param) throws Exception {
		smsService.send(smsType, subType, mobile, param);
		return ResultVOUtil.success();
	}

}
